package march.test_3_15;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int n = scanner.nextInt();
            int count = 0;
            if(n % 2 == 0) {
                count++;
                n /= 2;
            }
            if(n % 3 == 0) {
                count++;
                n /= 3;
            }
            while (n % 2 == 0 || n % 3 == 0) {
                if(n % 2 == 0) {
                    n /= 2;
                }
                if(n % 3 == 0) {
                    n /= 3;
                }
            }
            if(n >= 5) {
                if(isSushu(n)) {
                    count += 2;
                } else {
                    count += 1;
                }
            }
            System.out.println(count);
        }
    }
    public static boolean isSushu(int n) {
        for (int i = 5; i <= n/2; i++) {
            if(n % i == 0) {
                return true;
            }
        }
        return false;
    }
}
